home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
avwyyt1a
/
aol_32.bas
next >
Wrap
BASIC Source File
|
1997-02-19
|
12KB
|
432 lines
Attribute VB_Name = "AOL_32"
'***************************DECLARES***********************
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetNextWindow Lib "user32" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
'*************************CONSTANTS************************
Global Stop_Busting_In
Sub ADD_AOL_LB(itm As String, lst As ListBox)
'Add a list of names to a VB ListBox
'This is usually called by another one of my functions
If lst.ListCount = 0 Then
lst.AddItem itm
Exit Sub
End If
Do Until xx = (lst.ListCount)
Let diss_itm$ = lst.List(xx)
If Trim(LCase(diss_itm$)) = Trim(LCase(itm)) Then Let do_it = "NO"
Let xx = xx + 1
Loop
If do_it = "NO" Then Exit Sub
lst.AddItem itm
End Sub
Sub aolclick(E1 As Integer)
'Clicks an AOL button with the given handle as E1
Exit Sub
do_wn = SendMessageByNum(E1, WM_LBUTTONDOWN, 0, 0&)
Pause 0.008
u_p = SendMessageByNum(E1, WM_LBUTTONUP, 0, 0&)
End Sub
Function aolhwnd()
'finds AOL's handle
a = FindWindow("AOL Frame25", vbNullString)
aolhwnd = a
End Function
Sub AOLSendMail(Person, subject, message)
'Opens an AOL Mail and fills it out to PERSON, with a
'subject of SUBJECT, and a message of MESSAGE.
'*****THIS DOES NOT SEND THE MAIL !! ******
aol% = FindWindow("AOL Frame25", vbNullString)
If aol% = 0 Then
MsgBox "Must Be Online"
Exit Sub
End If
Call RunMenuByString(aol%, "Compose Mail")
Do: DoEvents
aol% = FindWindow("AOL Frame25", vbNullString)
mdi% = FindChildByClass(aol%, "MDIClient")
mailwin% = FindChildByTitle(mdi%, "Compose Mail")
icone% = FindChildByClass(mailwin%, "_AOL_Icon")
peepz% = FindChildByClass(mailwin%, "_AOL_Edit")
subjt% = FindChildByTitle(mailwin%, "Subject:")
subjec% = GetWindow(subjt%, 2)
mess% = FindChildByClass(mailwin%, "RICHCNTL")
If icone% <> 0 And peepz% <> 0 And subjec% <> 0 And mess% <> 0 Then Exit Do
Loop
a = SendMessageByString(peepz%, WM_SETTEXT, 0, Person)
a = SendMessageByString(subjec%, WM_SETTEXT, 0, subject)
a = SendMessageByString(mess%, WM_SETTEXT, 0, message)
'AOLIcon (icone%)
Do: DoEvents
aol% = FindWindow("AOL Frame25", vbNullString)
mdi% = FindChildByClass(aol%, "MDIClient")
mailwin% = FindChildByTitle(mdi%, "Compose Mail")
erro% = FindChildByTitle(mdi%, "Error")
aolw% = FindWindow("#32770", "America Online")
If mailwin% = 0 Then Exit Do
If aolw% <> 0 Then
a = SendMessage(aolw%, WM_CLOSE, 0, 0)
a = SendMessage(mailwin%, WM_CLOSE, 0, 0)
Exit Do
End If
If erro% <> 0 Then
a = SendMessage(erro%, WM_CLOSE, 0, 0)
a = SendMessage(mailwin%, WM_CLOSE, 0, 0)
Exit Do
End If
Loop
End Sub
Sub countnewmail()
'Counts your new mail...Mail doesn't have to be open
a = FindWindow("AOL Frame25", vbNullString)
Call RunMenuByString(a, "Read &New Mail")
AO% = FindWindow("AOL Frame25", vbNullString)
Do: DoEvents
bb% = FindChildByClass(AO%, "MDIClient")
arf = FindChildByTitle(bb%, "New Mail")
If arf <> 0 Then Exit Do
Loop
Hand% = FindChildByClass(arf, "_AOL_TREE")
buffer = SendMessage(Hand%, LB_GETCOUNT, 0, 0)
If buffer > 1 Then
MsgBox "You have " & buffer & " messages in your E-Mailbox."
End If
If buffer = 1 Then
MsgBox "You have one message in your E-Mailbox."
End If
If buffer < 1 Then
MsgBox "You have zero messages in your E-Mailbox"
End If
End Sub
Function findchatroom()
aol% = FindWindow("AOL Frame25", vbNullString)
mdi% = FindChildByClass(aol%, "MDIClient")
firs% = GetWindow(mdi%, 5)
listers% = FindChildByClass(firs%, "_AOL_Edit")
listere% = FindChildByClass(firs%, "_AOL_View")
listerb% = FindChildByClass(firs%, "_AOL_Listbox")
If listers% And listere% And listerb% Then GoTo bone
firs% = GetWindow(mdi%, GW_CHILD)
Do: DoEvents
firs% = GetWindow(firs%, 2)
listers% = FindChildByClass(firs%, "_AOL_Edit")
listere% = FindChildByClass(firs%, "_AOL_View")
listerb% = FindChildByClass(firs%, "_AOL_Listbox")
If listers% And listere% And listerb% Then Exit Do
aol% = FindWindow("AOL Frame25", vbNullString)
mdi% = FindChildByClass(aol%, "MDIClient")
firs% = GetWindow(mdi%, 5)
listers% = FindChildByClass(firs%, "_AOL_Edit")
listere% = FindChildByClass(firs%, "_AOL_View")
listerb% = FindChildByClass(firs%, "_AOL_Listbox")
If listers% And listere% And listerb% Then GoTo bone
l = l + 1
If l = 100 Then GoTo begis
Loop
bone:
room% = firs%
findchatroom = room%
Exit Function
begis:
findchatroom = 0
End Function
Function findcomposemail()
'Finds the Compose mail window's handle
Dim bb As Integer
Dim dis_win As Integer
dis_win = FindChildByClass(aolhwnd(), "AOL Child")
begin_find_composemail:
bb = FindChildByTitle(dis_win, "Send")
If bb <> 0 Then Let countt = countt + 1
bb = FindChildByTitle(dis_win, "To:")
If bb <> 0 Then Let countt = countt + 1
bb = FindChildByTitle(dis_win, "Subject:")
If bb <> 0 Then Let countt = countt + 1
bb = FindChildByTitle(dis_win, "Send" & Chr(13) & "Later")
If bb <> 0 Then Let countt = countt + 1
bb = FindChildByTitle(dis_win, "Attach")
If bb <> 0 Then Let countt = countt + 1
bb = FindChildByTitle(dis_win, "Address" & Chr(13) & "Book")
If bb <> 0 Then Let countt = countt + 1
If countt = 6 Then
findcomposemail = dis_win
Exit Function
End If
Let countt = 0
dis_win = GetNextWindow(dis_win, 2)
If dis_win = GetWindow(dis_win, GW_HWNDLAST) Then
findtocomposemail = 0
Exit Function
End If
GoTo begin_find_composemail
End Function
Function r_backwards(strin As String)
'Returns the strin backwards
Let inptxt$ = strin
Let lenth% = Len(inptxt$)
Do While numspc% <= lenth%
Let numspc% = numspc% + 1
Let nextchr$ = Mid$(inptxt$, numspc%, 1)
Let newsent$ = nextchr$ & newsent$
Loop
r_backwards = newsent$
End Function
Function r_elite(strin As String)
'Returns the strin elite
Let inptxt$ = strin
Let lenth% = Len(inptxt$)
Do While numspc% <= lenth%
DoEvents
Let numspc% = numspc% + 1
Let nextchr$ = Mid$(inptxt$, numspc%, 1)
Let nextchrr$ = Mid$(inptxt$, numspc%, 2)
If nextchrr$ = "ae" Then Let nextchrr$ = "µ": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
If nextchrr$ = "AE" Then Let nextchrr$ = "╞": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
If nextchrr$ = "oe" Then Let nextchrr$ = "£": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
If nextchrr$ = "OE" Then Let nextchrr$ = "î": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
If crapp% > 0 Then GoTo dustepp2
If nextchr$ = "A" Then Let nextchr$ = "/\"
If nextchr$ = "a" Then Let nextchr$ = "σ"
If nextchr$ = "B" Then Let nextchr$ = "▀"
If nextchr$ = "C" Then Let nextchr$ = "╟"
If nextchr$ = "c" Then Let nextchr$ = "ó"
If nextchr$ = "D" Then Let nextchr$ = "╨"
If nextchr$ = "d" Then Let nextchr$ = "≡"
If nextchr$ = "E" Then Let nextchr$ = "╩"
If nextchr$ = "e" Then Let nextchr$ = "Φ"
If nextchr$ = "f" Then Let nextchr$ = "â"
If nextchr$ = "H" Then Let nextchr$ = "|-|"
If nextchr$ = "I" Then Let nextchr$ = "ç"
If nextchr$ = "i" Then Let nextchr$ = "ε"
If nextchr$ = "k" Then Let nextchr$ = "|ï"
If nextchr$ = "L" Then Let nextchr$ = "ú"
If nextchr$ = "M" Then Let nextchr$ = "|V|"
If nextchr$ = "m" Then Let nextchr$ = "^^"
If nextchr$ = "N" Then Let nextchr$ = "/\/"
If nextchr$ = "n" Then Let nextchr$ = "±"
If nextchr$ = "O" Then Let nextchr$ = "╪"
If nextchr$ = "o" Then Let nextchr$ = "║"
If nextchr$ = "P" Then Let nextchr$ = "╢"
If nextchr$ = "p" Then Let nextchr$ = "▐"
If nextchr$ = "r" Then Let nextchr$ = "«"
If nextchr$ = "S" Then Let nextchr$ = "º"
If nextchr$ = "s" Then Let nextchr$ = "$"
If nextchr$ = "t" Then Let nextchr$ = "å"
If nextchr$ = "U" Then Let nextchr$ = "┌"
If nextchr$ = "u" Then Let nextchr$ = "╡"
If nextchr$ = "V" Then Let nextchr$ = "\/"
If nextchr$ = "W" Then Let nextchr$ = "VV"
If nextchr$ = "w" Then Let nextchr$ = "vv"
If nextchr$ = "X" Then Let nextchr$ = "X"
If nextchr$ = "x" Then Let nextchr$ = "╫"
If nextchr$ = "Y" Then Let nextchr$ = "Ñ"
If nextchr$ = "y" Then Let nextchr